package com.ibigcat.module.mdm.dao.mapper;

import java.util.*;

import com.ibigcat.framework.common.pojo.PageResult;
import com.ibigcat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ibigcat.framework.mybatis.core.mapper.BaseMapperX;
import com.ibigcat.module.mdm.dao.entity.OperatorLogDO;
import org.apache.ibatis.annotations.Mapper;
import com.ibigcat.module.mdm.controller.admin.operatorlog.vo.*;

/**
 * 操作日志 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OperatorLogMapper extends BaseMapperX<OperatorLogDO> {

    default PageResult<OperatorLogDO> selectPage(OperatorLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OperatorLogDO>()
                .eqIfPresent(OperatorLogDO::getTargetObj, reqVO.getTargetObj())
                .eqIfPresent(OperatorLogDO::getTargetAlldata, reqVO.getTargetAlldata())
                .eqIfPresent(OperatorLogDO::getSourceAlldata, reqVO.getSourceAlldata())
                .eqIfPresent(OperatorLogDO::getSourceType, reqVO.getSourceType())
                .eqIfPresent(OperatorLogDO::getSourceId, reqVO.getSourceId())
                .betweenIfPresent(OperatorLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OperatorLogDO::getId));
    }

}